 {
        
        var o = require("./UISoundManager.js"), i = require("./UIPopupBase.js");
        cc.Class({
            extends: i,
            properties: {},
            onLoad: function () {
                this._reward_list1 = Global.utils.searchNode(this.node, "reward_list1"), this._reward_list2 = Global.utils.searchNode(this.node, "reward_list2"),
                    this._btn_receive = Global.utils.searchNode(this.node, "btn_receive"), this._btn_close = Global.utils.searchNode(this.node, "Btn_Closed"),
                    this.mask = Global.utils.searchNode(this.node, "mask"), this._btnDoubleReceive = Global.utils.searchNode(this.node, "Btn_doublereceive"),
                    this._normalLine = Global.utils.searchNode(this.node, "Normalline"), this._btnNormalReceive = Global.utils.searchNode(this._normalLine, "Btn_normalreceive"),
                    this._btnDoubleReceive.active = !1, this._normalLine.active = !1, this._btn_receive.active = !1,
                    this._btn_close.active = !1, this.mask.off("touchend", this.OnPanelClose, this),
                    Global.notificationCenter.on(Global.eventName.UPDATE_ROOMINFO_SUCCESSED, this.updateRooms.bind(this), this),
                    this.defaultPlayMode = Global.config.playModel.XUELIU;
            },
            init: function () {
            },
            setData: function (e) {
                if (null != e) {
                    this._itemData = e.daysRewards, this._currentDay = e.checkInDays + 1, this._isCheckIn = e.todayCheckIn;
                    var t = 0;
                    if (this._reward_list1 && cc.isValid(this._reward_list1)) {
                        var n = this._reward_list1.childrenCount;
                        for (t = 0; t < n; t++) {
                            var o = this._reward_list1.children[t], i = this._itemData[t];
                            this.operateItemData(o, i);
                        }
                    }
                    if (this._reward_list2 && cc.isValid(this._reward_list2)) for (var a = this._reward_list2.childrenCount, r = t; r < a + t; r++) {
                        var s = this._reward_list2.children[r - t], l = this._itemData[r];
                        this.operateItemData(s, l);
                    }
                    this.operateClickBtn(this._isCheckIn);
                } else console.error("null==result");
            },
            operateClickBtn: function (e) {
                var t = Global.utils.searchNode(this._btn_receive, "icon").getComponent(cc.Sprite);
                if (e) this._btn_close && (this._btn_close.active = !0), this._btn_receive && (this._btn_receive.active = !0),
                this._btn_receive && (this._btn_receive.color = new cc.Color(255, 255, 255)), this._btn_receive && (this._btn_receive.off("touchend", this.OnClickReceive, this),
                    this._btn_receive.on("touchend", this.OnClickQuickStart, this)), t && cc.isValid(t) && (t.node.color = new cc.Color(255, 255, 255),
                    Global.spriteAtlas.setSpriteFrame(t, "Texture/select", "kuaisu"), this.mask.on("touchend", this.OnPanelClose, this)); else if (this._btn_close && (this._btn_close.active = !1),
                    Global.configCdn.getUISwitch()) {
                    if (this._btnDoubleReceive && this._normalLine) {
                        this._btnDoubleReceive.active = !0, this.scheduleOnce(function () {
                            this._normalLine && cc.isValid(this._normalLine) && (this._normalLine.active = !0,
                                this._normalLine.color = new cc.Color(255, 219, 86));
                        }.bind(this), 1.6), this._btnDoubleReceive.color = new cc.Color(255, 255, 255);
                        var n = Global.utils.searchNode(this._btnDoubleReceive, "sprite_doubleicon").getComponent(cc.Sprite);
                        n && (n.node.color = new cc.Color(255, 255, 255)), this._btnNormalReceive.color = new cc.Color(255, 219, 86),
                            this._btnDoubleReceive.on("touchend", this.OnClickDoubleReceive, this), this._btnNormalReceive.on("touchend", this.OnClickReceive, this);
                    }
                } else this._btn_receive && cc.isValid(this._btn_receive) && (this._btn_receive.active = !0,
                    this._btn_receive.color = new cc.Color(255, 255, 255), this._btn_receive.on("touchend", this.OnClickReceive, this),
                    this._btn_receive.getComponent(cc.Button).interactable = !0, t && cc.isValid(t) && (t.node.color = new cc.Color(255, 255, 255)));
            },
            updateRooms: function () {
                this.isClickStart && (Global.roomInfoModel.setPlayModel(this.defaultPlayMode), this.doQuickStart());
            },
            OnClickQuickStart: function () {
                if (this.isClickStart = !0, Global.roomInfoModel && 1 == Global.roomInfoModel.hasXueLiuRooms()) Global.roomInfoModel.setPlayModel(this.defaultPlayMode),
                    this.doQuickStart(); else {
                    var e = Global.config.GAMEID;
                    Global.msgHandler.requestRoomList(this.defaultPlayMode, e);
                }
            },
            doQuickStart: function (e) {
                if ((e = e || Global.roomInfoModel.getRecommendRoomId()) < 0) {
                    cc.error("loginRewardPanel onClickQuickStart roomId<0");
                    var t = {
                        text: "金币不足，快去分享获取金币吧！",
                        cancelSp: Global.spriteAtlas.getGoInviteSpf(),
                        cancelText: "去邀请",
                        cancelCallback: function () {
                            Global.UIPopupManager.addPopup("PopupPanel/Panel_InviteFri", function (e) {
                            });
                        },
                        closeCallback: function () {
                            console.log("closeCallback");
                        },
                        needConfirmBtn: !1
                    };
                    Global.UIPopupManager.alert(t);
                } else {
                    Global.roomInfoModel.setRoomId(e);
                    var n = Global.roomInfoModel.getPlayModel();
                    Global.msgHandler.requestQuickStart(n, e);
                }
            },
            operateItemData: function (e, t) {
                var n = Global.utils.searchNode(e, "date"), o = Global.utils.searchNode(e, "icon"),
                    i = Global.utils.searchNode(e, "money"), a = e.getComponent(cc.Sprite),
                    r = n.getComponent(cc.Label), s = o.getComponent(cc.Sprite), l = i.getComponent(cc.Label);
                this._currentDay != t.days || this._isCheckIn || (t.days == this._itemData.length ? Global.spriteAtlas.setSpriteFrame(a, "Texture/Rewards", "DL_5") : Global.spriteAtlas.setSpriteFrame(a, "Texture/Rewards", "DL_3")),
                    r.string = "第" + t.days + "天", 1 == t.state ? (e.opacity = 127.5, Global.spriteAtlas.setSpriteFrame(s, "Texture/Rewards", "DL_7")) : t.days == this._itemData.length ? Global.spriteAtlas.setSpriteFrame(s, "Texture/Rewards", "WP_3") : Global.spriteAtlas.setSpriteFrame(s, "Texture/Rewards", "WP_1"),
                    l.string = "x" + t.desc.substring(0, t.desc.length - 2);
            },
            OnClickReceive: function () {
                Global.msgHandler.requestSevenDays_checkin("checkin", 0), this.closePanel(), o.playEffect("select");
            },
            OnClickDoubleReceive: function () {
                var e = this;
                Global.utils.showViewAd(Global.config.adUnitId, function () {
                    e.scheduleOnce(function () {
                        Global.msgHandler.requestSevenDays_checkin("checkin", 1), e.closePanel();
                    }, .1);
                }, function () {
                    Global.utils.showNodeCommon("您在播放中途退出，无法领取游戏奖励", 3);
                }), o.playEffect("select");
            },
            OnPanelClose: function () {
                o.playEffect("select"), this.closePanel();
            }
        })
    }